unit UnitArrecadaMensConv;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RLParser, RLFilters, RLXLSFilter, DB, ADODB, RLReport;

type
  TRelArrecadaMensConv = class(TForm)
    rlRelatorio: TRLReport;
    qryConsulta: TADOQuery;
    dsConsulta: TDataSource;
    RLXLSFilter1: TRLXLSFilter;
    RLExpressionParser1: TRLExpressionParser;
    RLGroup1: TRLGroup;
    RLBand1: TRLBand;
    RLImage1: TRLImage;
    RLSystemInfo1: TRLSystemInfo;
    rlCabecalho: TRLLabel;
    RLSystemInfo2: TRLSystemInfo;
    rlTipo: TRLLabel;
    linTopo: TRLDraw;
    RLDraw2: TRLDraw;
    RLLabel1: TRLLabel;
    RLLabel2: TRLLabel;
    RLDraw1: TRLDraw;
    RLDraw3: TRLDraw;
    RLLabel3: TRLLabel;
    RLLabel4: TRLLabel;
    RLDraw4: TRLDraw;
    RLLabel5: TRLLabel;
    RLDraw5: TRLDraw;
    RLLabel6: TRLLabel;
    RLDraw6: TRLDraw;
    RLLabel7: TRLLabel;
    RLDraw7: TRLDraw;
    RLLabel8: TRLLabel;
    RLDraw8: TRLDraw;
    RLLabel9: TRLLabel;
    rldbConvenio: TRLDBText;
    qryConsultaNOMECONV: TStringField;
    qryConsultaCONVENIO: TIntegerField;
    qryConsultaANOMES: TStringField;
    qryConsultaANO: TIntegerField;
    qryConsultaMES: TIntegerField;
    qryConsultaGUIAS: TIntegerField;
    qryConsultaVALOR: TBCDField;
    qryConsultaCOMISSAO: TBCDField;
    qryConsultaCPMF: TBCDField;
    gAgrupar: TRLGroup;
    RLBand2: TRLBand;
    RLDraw9: TRLDraw;
    RLDraw10: TRLDraw;
    RLDraw11: TRLDraw;
    RLDraw12: TRLDraw;
    RLDraw13: TRLDraw;
    RLDraw14: TRLDraw;
    RLDraw15: TRLDraw;
    RLDraw16: TRLDraw;
    RLDBResult1: TRLDBResult;
    RLDBResult2: TRLDBResult;
    RLDBResult3: TRLDBResult;
    RLDBResult4: TRLDBResult;
    RLDBResult5: TRLDBResult;
    RLDBResult6: TRLDBResult;
    RLDBResult7: TRLDBResult;
    RLDBResult8: TRLDBResult;
    RLDBResult9: TRLDBResult;
    RLBand3: TRLBand;
    RLDraw17: TRLDraw;
    RLDraw18: TRLDraw;
    RLDraw19: TRLDraw;
    RLDraw20: TRLDraw;
    RLDraw21: TRLDraw;
    RLDraw22: TRLDraw;
    RLDraw23: TRLDraw;
    RLDraw24: TRLDraw;
    RLDraw25: TRLDraw;
    RLLabel10: TRLLabel;
    RLLabel11: TRLLabel;
    rlTotGuias: TRLDBResult;
    rlTotValor: TRLDBResult;
    RLDBResult12: TRLDBResult;
    RLDBResult13: TRLDBResult;
    rlTotal: TRLDBResult;
    RLDBResult17: TRLDBResult;
    RLDBResult15: TRLDBResult;
    RLDBResult16: TRLDBResult;
    RLDBResult18: TRLDBResult;
    RLDBResult19: TRLDBResult;
    RLDBResult20: TRLDBResult;
    RLDBResult21: TRLDBResult;
    rlGuiaMedia: TRLLabel;
    rlPercMedia: TRLLabel;
    RLBand4: TRLBand;
    RLDraw26: TRLDraw;
    RLDraw27: TRLDraw;
    RLDraw28: TRLDraw;
    RLDraw29: TRLDraw;
    RLDraw30: TRLDraw;
    RLDraw31: TRLDraw;
    RLDraw32: TRLDraw;
    RLDraw33: TRLDraw;
    RLDraw34: TRLDraw;
    RLLabel12: TRLLabel;
    RLLabel13: TRLLabel;
    RLDBResult10: TRLDBResult;
    RLDBResult11: TRLDBResult;
    RLDBResult14: TRLDBResult;
    RLDBResult22: TRLDBResult;
    RLDBResult23: TRLDBResult;
    RLDBResult24: TRLDBResult;
    RLDBResult25: TRLDBResult;
    RLDBResult26: TRLDBResult;
    RLDBResult27: TRLDBResult;
    RLDBResult28: TRLDBResult;
    RLDBResult29: TRLDBResult;
    RLDBResult30: TRLDBResult;
    RLLabel14: TRLLabel;
    RLLabel15: TRLLabel;
    RLDraw35: TRLDraw;
    RLDraw36: TRLDraw;
    RLLabel16: TRLLabel;
    memConvenios: TRLMemo;
    procedure RLBand3BeforePrint(Sender: TObject; var PrintIt: Boolean);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure RLBand1BeforePrint(Sender: TObject; var PrintIt: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RelArrecadaMensConv: TRelArrecadaMensConv;

implementation

uses UnitPrincipal;

{$R *.dfm}

procedure TRelArrecadaMensConv.RLBand3BeforePrint(Sender: TObject;
  var PrintIt: Boolean);
begin
  rlGuiaMedia.Caption := FloatToStrF(rlTotValor.Value/rlTotGuias.Value,ffNumber,15,2);
  rlPercMedia.Caption := FloatToStrF(rlTotal.Value/rlTotValor.Value*100,ffNumber,15,2);
end;

procedure TRelArrecadaMensConv.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TRelArrecadaMensConv.RLBand1BeforePrint(Sender: TObject;
  var PrintIt: Boolean);
begin
  linTopo.Top := RLBand1.Height-16;
end;

end.
